<?php
header("Cache-Control: no-cache, must-revalidate"); // HTTP/1.1
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT"); // Date in the past


//include ABSPATH."include/config_mykad.php";
//include ABSPATH."include/configDB.php";

include "include/browser_detection.php";
include ABSPATH."helpers/gui.php";
include ABSPATH."helpers/application_helper.php";

$photo_dir = "photos/";

if ($ENABLE_LOGIN) {
	switch ($AUTH_TYPE) {
		case 'LDAP':
			require_once(ABSPATH.'plugins/auth_ldap.php');
			break;
		case 'ADVANCED':
			require_once(ABSPATH.'plugins/auth_advanced.php');
			break;
		case 'NORMAL':
			require_once(ABSPATH.'plugins/auth.php');
			break;
		default:
			require_once(ABSPATH.'plugins/auth.php');
			break;
	}
}	
else $local_conn = db_connect();

//session start
session_register('flash');


// Change to E_ALL for development/debugging
//error_reporting(E_ALL ^ E_NOTICE);


function db_connect() {
	global $dbname,$dbuser,$dbhost,$dbport,$dbpass;
	return pg_connect("host=$dbhost port=$dbport dbname=$dbname user=$dbuser password=$dbpass");
}

function db_connectku() {
	global $remote_dbname,$remote_dbuser,$remote_dbhost,$remote_dbport,$remote_dbpass;
	return pg_connect("host=$remote_dbhost port=$remote_dbport dbname=$remote_dbname user=$remote_dbuser password=$remote_dbpass");
}
?>
